<?php

class User_model extends CI_Model {

    function __construct() {
        parent::__construct();
    }

    function findUser($email, $password) {
        $this->db->select('Email, Wachtwoord');
        $this->db->from('gebruikers');
        
        $this->db->where('Email', $email);
        $this->db->where('Wachtwoord', $password);
        $query = $this->db->get();
        
        if ($query->result() != null) {

            return true;
        }else{
            
             return false;
        }
    }

    function getUserId($email, $password) {
        $this->db->select('id', 'Email, Wachtwoord');
        $this->db->from('gebruikers');
        
        $this->db->where('Email', $email);
        $this->db->where('Wachtwoord', $password);
        $query = $this->db->get();

        $arr = $query->result();
        return $arr[0]->id;
    }

}

?>
